//		ID : Xerxes
//      "I have not failed, I have just found 10000 ways that won't work.
//


#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>

#include <ctime>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>
#include <cstdlib>

using namespace std;

#define VI vector< int >
#define CI( x ) scanf("%d",&x)
#define CL( x ) scanf("%lld",&x)
#define CD( x ) scanf("%lf",&x )
#define fo(i,st,ed) for(int i = st ; i < ed ; ++i )
#define foE(i,st,ed) for(int i = st ; i <= ed ; ++i )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define f first
#define s second
#define SET( ARRAY , VALUE ) memset( ARRAY , VALUE , sizeof(ARRAY) )
#define tp pair< int, pair<int,int> >
#define mmk( x, y , z ) mk( x, mk( y, z ) )

inline void wait( double seconds ){
    double endtime = clock()+( seconds* CLOCKS_PER_SEC );
    while( clock() < endtime ){
        ;
    }
}
int cases;
int N,R;
int mat[103][103];
int sx,sy,sc;
inline void ini(){
	foE(i,1,100){
		foE(j,i+1,100){
			mat[i][j] = mat[j][i] = -1;
		}
		mat[i][i]=0;
	}
}
inline void Read(){	
	int x,y,c;
	ini();
	fo(i,0,R){
		scanf("%d %d %d",&x,&y,&c);
		mat[x][y]=mat[y][x]=c;
	}
		scanf("%d %d %d",&sx,&sy,&sc);
	
}
inline void floyed_warshall(){
		foE(i,1,N){
			foE(j,1,N){
				foE(k,1,N){
					if( mat[j][i]!= -1 || mat[i][k]!=-1 )
						mat[j][k] = max( mat[j][k], min( mat[j][i], mat[i][k] ) );
				}
			}
		}
				
			
}
inline void Proc(){
		floyed_warshall();
		int i;
		int cap = mat[sx][sy];
		for(i=1; ;++i){
		   		sc = (sc+1) - ( cap);	
		   		if( sc <=0 )break;
		}	
		
		printf("Scenario #%d\nMinimum Number of Trips = %d\n\n",cases,i);
}

int main(){
    #ifndef ONLINE_JUDGE
        freopen("in","rt",stdin);
    #endif
    cases=1;
    for( ; scanf("%d %d",&N,&R)==2  ; ++cases ){
		if( N==0 && R==0 )break;
        Read();
        Proc();
    }

return 0;
}



